﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

using System.Data;
using YouErYuanModels;
using CommonLib;
using System.Data.SqlClient;

namespace YouErYuanBLL
{
    /// <summary>
    /// 异常错误日志记录处理
    /// </summary>
    public class ErrorLogBLL
    {
        /// <summary>
        /// 添加异常错误日志记录
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public int AddErrorLog(ManageErrorLog model)
        {
            string sql = "INSERT INTO [dbo].[T_ManageErrorLog]([id],[className],[lineNo],[errorMsg],[createTime]) VALUES(@id,@className,@lineNo,@errorMsg,@createTime)";
            SqlParameter[] parmas = {
                new SqlParameter("@id",model.Id),
                new SqlParameter("@className",model.Classname),
                new SqlParameter("@lineNo",model.Lineno),
                new SqlParameter("@errorMsg",model.Errormsg),
                new SqlParameter("@createTime",DateTime.Now)
            };
            int count = SQLHepler.ExecuteSql(sql, parmas);
            return count;
        }


    }
}
